<template>
  <div id="app">
    <div id="nav">
      <router-link to="/">Home</router-link> |
      <router-link :to="{path: '/about'}">About</router-link>
    </div>
    <div> App.vue router view 上面</div>
    <router-view/>
    <div> App.vue router view 下面</div>
    <div>
      <button @click="gohome">go Home</button>   |
      <button @click="goabout">go About</button> |
      <button @click="gocompany">go company</button> |
    </div>
  </div>
</template>

<script>
export default {
  methods: {
    gohome: function () {
      this.$router.push({name: 'Home'})
    },

    goabout: function () {
      this.$router.push({path: '/about', query: {from: 'app'}})
    },

    goback: function () {
      this.$router.go(-1)
    },
    gocompany: function () {
      this.$router.push({name: 'company', params: {from: 'App'}})
    }
  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

#nav {
  padding: 30px;
}

#nav a {
  font-weight: bold;
  color: #2c3e50;
}

#nav a.router-link-exact-active {
  color: #42b983;
}
.tip {
  color: red;
}
</style>
